package com.ruoyi.canteen.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.canteen.mapper.CanteenMdDeliverMapper;
import com.ruoyi.canteen.domain.CanteenMdDeliver;
import com.ruoyi.canteen.service.ICanteenMdDeliverService;

/**
 * 门店配送时间Service业务层处理
 * 
 * @author zhangw
 * @date 2021-09-30
 */
@Service
public class CanteenMdDeliverServiceImpl implements ICanteenMdDeliverService 
{
    @Autowired
    private CanteenMdDeliverMapper canteenMdDeliverMapper;

    /**
     * 查询门店配送时间
     * 
     * @param id 门店配送时间主键
     * @return 门店配送时间
     */
    @Override
    public CanteenMdDeliver selectCanteenMdDeliverById(Long id)
    {
        return canteenMdDeliverMapper.selectCanteenMdDeliverById(id);
    }

    /**
     * 查询门店配送时间列表
     * 
     * @param canteenMdDeliver 门店配送时间
     * @return 门店配送时间
     */
    @Override
    public List<CanteenMdDeliver> selectCanteenMdDeliverList(CanteenMdDeliver canteenMdDeliver)
    {
        return canteenMdDeliverMapper.selectCanteenMdDeliverList(canteenMdDeliver);
    }

    /**
     * 新增门店配送时间
     * 
     * @param canteenMdDeliver 门店配送时间
     * @return 结果
     */
    @Override
    public int insertCanteenMdDeliver(CanteenMdDeliver canteenMdDeliver)
    {
        return canteenMdDeliverMapper.insertCanteenMdDeliver(canteenMdDeliver);
    }

    /**
     * 修改门店配送时间
     * 
     * @param canteenMdDeliver 门店配送时间
     * @return 结果
     */
    @Override
    public int updateCanteenMdDeliver(CanteenMdDeliver canteenMdDeliver)
    {
        return canteenMdDeliverMapper.updateCanteenMdDeliver(canteenMdDeliver);
    }

    /**
     * 批量删除门店配送时间
     * 
     * @param ids 需要删除的门店配送时间主键
     * @return 结果
     */
    @Override
    public int deleteCanteenMdDeliverByIds(Long[] ids)
    {
        return canteenMdDeliverMapper.deleteCanteenMdDeliverByIds(ids);
    }

    /**
     * 删除门店配送时间信息
     * 
     * @param id 门店配送时间主键
     * @return 结果
     */
    @Override
    public int deleteCanteenMdDeliverById(Long id)
    {
        return canteenMdDeliverMapper.deleteCanteenMdDeliverById(id);
    }


    /**
     * 根据当前门店选择在用的配送时间
     * @param mdId 门店ID
     * @return
     */
    @Override
    public List<CanteenMdDeliver> selectCurDeliverListByMdId(Long mdId){
        return canteenMdDeliverMapper.selectCurDeliverListByMdId(mdId);
    }
}
